home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_item_tusken_clothes.cog < prev    next >
Text File  |  1998-02-25  |  3KB  |  117 lines

  1. # Jedi Knight Missions Cog Script
  2. #
  3. # ITEM_TUSKEN_CLOTHES.COG
  4. #
  5. # INVENTORY SCRIPT - Tusken Clothes
  6. #
  7. # [TT]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.  
  11.  
  12. symbols
  13.  
  14. thing    player                      local
  15. thing    playermodel                 local
  16. model    tusken=kyA15.3do            local
  17. model    oldModel                 local
  18.  
  19. int        iAlignmentPriority=-1    local
  20. int        destroyclothes=0        local
  21.  
  22. message    activated
  23. message    user0
  24. message    killed
  25.  
  26. sound    clothesActivate=activate01.wav
  27. sound    clothesDeactivate=deactivate03.wav
  28. sound       voiceline=MJ62102.wav
  29.  
  30. end
  31.  
  32. # ========================================================================================
  33.  
  34. code
  35.  
  36. activated:
  37.    player = GetSourceRef();
  38.    playermodel = jkGetLocalPlayer();
  39.  
  40.    if(GetInv(player, 52))
  41.    {
  42.         if (iAlignmentPriority != -1)
  43.         {
  44.          aiRemoveAlignmentPriority(iAlignmentPriority);
  45.  
  46.          iAlignmentPriority = -1;
  47.         }
  48.  
  49.       if(IsInvActivated(player, 52) == 0)
  50.         {
  51.             // Print("Tusken Clothes ON");
  52.             jkPrintUNIString(player, 271);
  53.             SetInvActivated(player, 52, 1);
  54.             PlaySoundThing(clothesActivate, player, 1.0, -1, -1, 0x80);
  55.  
  56.                 // Switch models, keeping track of the old one.
  57.             oldModel = SetThingModel(playermodel, tusken);
  58.  
  59.                 // If persuasion was on, set the geo mode back to where it should be.
  60.             if(IsInvActivated(player, 26))
  61.             SetThingCurGeoMode(player, 0);
  62.  
  63.                  iAlignmentPriority = aiAddAlignmentPriority(0.0, 1);
  64.         }
  65.         else
  66.         {
  67.                 // Print("Tusken Clothes OFF");
  68.             jkPrintUNIString(player, 272);
  69.             SetInvActivated(player, 52, 0);
  70.  
  71.                 // Switch back to the old model.
  72.             if(!IsInvActivated(player, 23))
  73.             SetThingModel(playermodel, oldModel);
  74.             PlaySoundThing(clothesDeactivate, player, 1.0, -1, -1, 0x80);
  75.  
  76.                 // If persuasion was on, set the geo mode back to where it should be.
  77.             if(IsInvActivated(player, 26))
  78.             SetThingCurGeoMode(player, 0);
  79.         }
  80.    }
  81.  
  82.    Return;
  83.  
  84. user0:
  85.        if(IsInvActivated(player, 52) == 1)
  86.         {
  87.             if (iAlignmentPriority != -1)
  88.             {
  89.                 aiRemoveAlignmentPriority(iAlignmentPriority);
  90.     
  91.                 iAlignmentPriority = -1;
  92.             }
  93.  
  94.             PlaySoundLocal(voiceline, 1.0, 0.0, 0);
  95.             // Print("Tusken Clothes OFF");
  96.             jkPrintUNIString(player, 272);
  97.             SetInvActivated(player, 52, 0);
  98.  
  99.                 // Switch back to the old model.
  100.             if(!IsInvActivated(player, 23))
  101.             SetThingModel(playermodel, oldModel);
  102.             PlaySoundThing(clothesDeactivate, player, 1.0, -1, -1, 0x80);
  103.  
  104.                 // If persuasion was on, set the geo mode back to where it should be.
  105.             if(IsInvActivated(player, 26))
  106.             SetThingCurGeoMode(player, 0);
  107.         }
  108.     SetInvAvailable(player, 52, 0);
  109.     return;
  110.  
  111. # ========================================================================================
  112.  
  113. killed:
  114.     return;
  115.  
  116. end
  117.